using UnityEngine;
using System.Collections;

public class UIButtonText : MonoBehaviour {

	public Color mouseOver;
	public Color mainColor;
	public Color mouseDown;
	public GameObject target;
	public Vector3 sizeOver;
	public Vector3 sizeMain;
	public Renderer renderText;
	public string functionName;
	public string message;
	
	void Awake()
	{
		if(mouseOver.a == 0 || mainColor.a == 0)
		{
			mouseOver = new Color(mouseOver.r,mouseOver.g,mouseOver.b,1);
			mainColor = new Color(mainColor.r,mainColor.g,mainColor.b,1);
			mouseDown = new Color(mouseDown.r,mouseDown.g,mouseDown.b,1);
		}
	}
		
	
	void OnMouseEnter () 
	{
		renderText.material.color = mouseOver;
		transform.localScale = sizeOver;
	}
	
	void OnMouseExit () 
	{
		renderText.material.color = mainColor;
		transform.localScale = sizeMain;
	}
	void OnMouseDown()
	{
		target.SendMessage(functionName,message,SendMessageOptions.DontRequireReceiver);
	}
	
}
